<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/styles/public.css" rel="stylesheet" type="text/css">
    <link href="/js/ueditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <link href="/js/datepicker/datepicker.css" rel="stylesheet">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/ueditor/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/ueditor/umeditor.min.js"></script>
    <script type="text/javascript" src="/js/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" src="/js/common.js"></script>
    <script type="text/javascript" src="/js/public.js"></script>

    <script src="/js/jquerytagsinput/js/jquery.tagsinput.js"></script>
    <link rel="stylesheet" type="text/css" href="/js/jquerytagsinput/css/jquery.tagsinput.css" />
    <script>
        $(function () {
            $('#tags').tagsInput();
            console.log(1);
            $('.qt-post-btn').click(function () {
                console.log(2);
                $.post("/question/saveOrUpdate",$('#editForm').serialize(),function (data) {
                    console.log(3);
                    if(data.success){
                        window.location.href = "/question/";
                    }else{
                        popup("操作失败");
                    }
                })
                /*$("#editForm").ajaxSubmit(function (data) {
                    if(data.success){
                    }else{
                        popup("操作失败");
                    }
                })*/
            })
        })
    </script>
</head>

<body>
<div class="wrapper">
    <div class="qt-container clearfix">
        <form class="forms" action="/question/saveOrUpdate" method="post" id="editForm">
        <div class="qt-main">
            <div class="crumb">
                <a href="/question/">旅游问答</a> &gt; <span>我要提问</span>
            </div>
            <div class="qt-tit">
                <h5>问题标题</h5>
                <div class="qt-con">
                    <input type="text" name="title" placeholder="标题不小于10字哦" class="_j_title">
                    <span class="count"><span class="_j_title_num">0</span>/80 字</span>
                    <span class="_j_min_num hide">10</span>
                    <span class="error err-tips _j_title_error">标题不能少于10字</span>
                </div>
            </div>

            <div class="qt-details">
                <h5><#--<a title="添加问答内容" class="icon active" id="_j_show_content"></a>-->问题详细内容</h5>
                <a class="level _j_filter_click" href="javascript:;" target="_blank"
                   rel="nofollow">问题不需要上传图片9哦 (⊙o⊙)</a>
                <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
            </div>
            <br>
            <h5>问题标签</h5>
            <a class="level _j_filter_click" href="javascript:;" target="_blank"
            rel="nofollow">输入完回车</a>
            <input name="tag" id="tags" value="foo,bar,baz" />
                    <br>
                    <br>
            <h5>目的地</h5>
            <select name="dest.id" id="region">
                <#list dests as r>
                    <option value="${r.id!}">${r.name!}</option>
                </#list>
            </select>
            <div class="publish_question">
                <a class="qt-post-btn _j_publish" title="发布问题">发布问题</a>
            </div>
        </div>
        </form>
        <div class="qt-sider">
            <div class="qts-tit">提问的正确姿势</div>
            <div class="qts-con">
                <p>1.问题要【具体】【真实】【诚恳】，问题较多，需全面阐述时，可以添加问题补充。结伴/交易/与旅行无关的提问将被删除。</p>
                <p>2.给问题添加目的地，并打上正确的标签将有助于更快地获得回答。</p>
            </div>
        </div>
    </div>
</div>
</body>

</html>